package com.lzy.shops.bean;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.text.SimpleDateFormat;
import java.util.Date;

@NoArgsConstructor
@Data
public class User {
    private Long id;
    private String gender; // 性别
    private String userName; // 用户名
    private String phone; // 电话
    private String anotherName; // 别名
    private String password; // 密码
    private Double balance; // 余额
    @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss", timezone = "GMT+8")
    private Date register_time; // 注册时间
    private Date last_login_time; // 上次登录时间
    private Integer qq; // qq账号
    private String email; // 邮箱
    private String role; // 角色  buy买家/sel卖家

    public User(String userName,String password){
        this.userName = userName;
        this.password = password;
    }

    public User(String userName){
        this.userName = userName;
    }

    public User(Long UserId,Date last_login_time){
        this.id = UserId;
        this.last_login_time = last_login_time;
    }
}
